function setCookie(name, value, expires, path) {
	var oDate = new Date();
	oDate.setDate(oDate.getDate() + expires);

	// 写入cookie
	document.cookie = name + '=' + encodeURIComponent(value) + ';expires=' + oDate + ';path=' + path;
}

function getCookie(name) {
	var aCookie = document.cookie.split('; ');
	for(var i = 0; i < aCookie.length; i++) {
		var oTemp = aCookie[i].split('=');

		if(oTemp[0] === name) {
			return decodeURIComponent(oTemp[1]);
		}
	}
	return false;
}